package com.ruibei.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import butterknife.ButterKnife;
import butterknife.InjectView;

import com.ruibei.R;
import com.ruibei.view.processbtn.ActionProcessButton;
import com.ruibei.view.processbtn.ProgressGenerator;

/**
 * 
 * @author wu 登录界面
 */
public class LoginActivity extends BaseActivity implements ProgressGenerator.OnCompleteListener{

	@InjectView(R.id.butt_login)
	ActionProcessButton LoginBtn;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		ButterKnife.inject(this);
		final ProgressGenerator progressGenerator = new ProgressGenerator(this);
		LoginBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				progressGenerator.start(LoginBtn);
			}
		});
	}
	
//	@Override
//	public void onClick(View v) {
//		// TODO Auto-generated method stub
//		switch (v.getId()) {
//			case R.id.butt_login:
//				startActivity(new Intent(this, MainActivity.class));
//				finish();
//			break;	
//		}
//	}

	@Override
	public void onComplete() {
		// TODO Auto-generated method stub
		startActivity(new Intent(this, MainActivity.class));
		finish();
	}
}
